home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / comm / fido / SHELTER275.lha / DOCS / Xferq.Addendum < prev    next >
Text File  |  1994-05-01  |  3KB  |  83 lines

  1.  
  2.            Addendum to XferQ.library Developer's Documentation
  3.                                   by
  4.                             Robert Williamson  
  5.  
  6.           Xferq.Library is by David Jones
  7.                               6730 Tooney Drive
  8.                               Orleans, Ontario
  9.                               K1C 6R4
  10.                               CANADA
  11.  
  12.                               email: aa457@freenet.carleton.ca
  13.                               fido: 1:163/109.8
  14.  
  15.  
  16.     Disposition of files:
  17.  
  18.         The Developer's Documentation does not indicate that a file will be
  19. deleted  if  the session goes down without having sent it AND it was queued
  20. with the user flags XQ_DELETE and XQ_IMMEDIATE.  This ftn-specific quirk is
  21. used  by  wpl.library  to  delete those temporary packets it creates during
  22. sessions  that  require  a  dummy or poll packet.  However this specificity
  23. violates the multi-network nature of xferq.library.
  24.  
  25.         Since  wpl.library  source is not yet available, it is not possible
  26. the  correct  it so that it respects it's responsibility to delete it's own
  27. temporary  files.  Therefore, this version of xferq.library ADDS a new user
  28. flag  to insure that one IS able to queue a file in immediate mode with the
  29. confidence that it will NOT be deleted if it was NOT SENT.
  30.  
  31.         This  new  user  flag is XQ_IFSENT.  It only comes into play IF the
  32. session  goes  down  without  sending  the  file.   If  both  XQ_DELETE and
  33. XQ_IMMEDIATE  are true, and XQ_IFSENT is TRUE, the file will NOT be deleted
  34. if it has not been sent.
  35.  
  36.         These  changes  should  be  both  compatible and transparent to all
  37. applications.    Only   those   applications  that  actually  followed  the
  38. documentation will have to be changed.
  39.  
  40.         For those interested the code changes are as follows:
  41.  
  42.     xferq.h:
  43.  
  44.     /*
  45.     *   User flags
  46.     */
  47.  
  48.     #define    XQ_DELETE       1   /* Delete file after sending */
  49.     #define    XQ_TRUNCATE     2   /* Truncate file after sending */
  50.     #define    XQ_IMMEDIATE    4   /* Send only if session currently up */
  51.     #define    XQ_SENDLATER    8   /* Make eligible after session goes down */
  52.     #define XQ_IFSENT       16  /* DO NOT Delete if XQ_DELETE+XQ_IMMEDIATE */
  53.                                 /* and file not sent */
  54.  
  55.  
  56.     queue.c:
  57.     void SessionDownQueue(struct SiteQueue *sq)
  58.     /*
  59.      *  In: sq              Site node to scan for dead work
  60.      *
  61.      * Does:    All sessions just went down, so remove all IMMEDIATE nodes and
  62.      *          clear the SENDLATER bits.
  63.      */
  64.     {
  65.         struct WorkNode *wn, *twn;
  66.         wn = FIRST(&sq->workList);
  67.         while (twn = NEXT(wn)) {
  68.             wn->userFlags &= ~XQ_SENDLATER;
  69.             if (wn->userFlags & XQ_IMMEDIATE) {
  70.                 if (wn->userFlags & XQ_IFSENT)
  71.                     wn->status = XQ_UNSENT;
  72.                 else
  73.                     wn->status = XQ_SENT;
  74.                 LibRemoveWork(wn);
  75.                 LibDropObject(wn);
  76.             }
  77.             wn = twn;
  78.         }
  79.     }
  80.  
  81.     -eot-
  82.  
  83.